window.addEvent('domready', function(){
if($('tabsToolsService-nav')!=null){
	new Asset.javascript('scriptaplicacion/AcordeonToolsService.js', {id: '6'});
	$('tabsToolsService-nav').getElements('a').each(function(i) {
		i.addEvent('click', function(event){
			event.stop();
			Tab(i.get('id'));
		});
	});
	}
});
function Tab(key){

	$('tabsToolsService-nav').getElements('li').each(function(i) {
		i.set('id','#');
	})
	$(key).getParent().set('id','current');
	//alert("Hola ");
	var req = new Request({
		url: 'views/ToolsServiceController.php?tab=' + key,
		method: 'get',
		onRequest: function() {
				$('cargando' + '-loading').set('html', '<img src=\'views/img/ajax-loader.gif\' width=\'16\' height=\'16\' alt=\'Loading\' /> Loading...');
		},
		onSuccess: function(responseText) {
			$('cargando' + '-loading').set('html','');
			$('tabs-content').set('html',responseText);
			new Asset.javascript('scriptaplicacion/AcordeonToolsService.js', {id: '6'});
		}
	}).send();
}